package com.wsq.demo01.mapper;

import com.wsq.demo01.pojo.StudentInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {

    List<StudentInfo> queryStudentList();

    void addStudentInfo(StudentInfo studentInfo);

    void deleteStudent(String name);

    // 获取接口参数查询
    StudentInfo testSelectByName(String name);

    // 获取接口参数新增信息
    void testAdd(Map<String, Object> map);

    // 获取接口参数修改信息
    void testUpdate(Map<String, Object> map);

    /*redis做缓存:根据id获取student*/
    @Select("select * from student_info where id =#{id}")
    StudentInfo findUserById(Integer id);

    /*redis做缓存:根据name获取student*/
    @Select("select * from student_info where name = #{name}")
    StudentInfo findUserByName(String name);
}
